package com.shchekoldin.juliet.json.annotation;

import com.shchekoldin.juliet.json.JsonFieldConverter;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ ElementType.METHOD, ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
public @interface ToJson {

    static final class NULL_CONVERTER implements JsonFieldConverter {
        @Override
        public Object convert(Object value) { return null; }
    }

    Class<? extends JsonFieldConverter> converter() default NULL_CONVERTER.class;

    String jsonName() default "";

    String[] profiles();

    String[] includeOnly() default { };

}
